﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MiniIOC.IOCLIbs
{
    public static class ServiceProviderExtentions
    {
        public static IScopedServiceProvider CreateScope(this IServiceProvider serviceProvider)
        {
            if (serviceProvider is IScopedServiceProvider) throw new InvalidOperationException("只有跟容器才能创建 Scoped 容器");
            return new ScopedServiceProvider(serviceProvider);
        }
    }
}
